<?php
            $tag = new tag();
            include_once $config ['client_theme_path'].$config ['client_theme'].'/header.php';
            $articles = $tag->getArticlesByTag();
            if($config['page']>1) {
                $config['site_title'] = 'Trang '.$config['page'].' - '.$articles['tag_name'] . ' - ' . nosignTitle($articles['tag_name']) .' - BanTinNhaDat.vn';
                $config['site_description'] = 'Trang '.$config['page'].' - '.$articles['tag_name'] . ' - ' . nosignTitle($articles['tag_name']) .' - '. $config['site_description'];
                $config['site_keyword'] = 'Trang '.$config['page'].' - '.$articles['tag_name'] . ',' . nosignTitle($articles['tag_name']) .', '. $config['site_keyword'];
            }else {
                $config['site_title'] = $articles['tag_name'] . ' - ' . nosignTitle($articles['tag_name']) .' - BanTinNhaDat.vn';
                $config['site_description'] = $articles['tag_name'] . ' - ' . nosignTitle($articles['tag_name']) .' - '. $config['site_description'];
                $config['site_keyword'] = $articles['tag_name'] . ',' . nosignTitle($articles['tag_name']) .', '. $config['site_keyword'];
            }

?>
<div id="container">
    	<div class="cat-details">
            <ul class="listcate">
                <?php
                    $e=0;
                    while($rs=$db->fetch_array($articles['rsArticles'])) {
                       $e++;                   
                ?>
            	<li <?php if($e == 1){ echo 'class="top"';}?>>
                    <a href="/<?php echo $rs['link'];?>.html" title="<?php echo viewTitleLink($rs['title']);?>">
                        <img src="<?php echo createThumb($rs['image'],'357-266');?>" alt="<?php echo $rs['title'];?>" class="thumb" />
                    </a>
                    <h2><a href="/<?php echo $rs['link'];?>.html" title="<?php echo viewTitleLink($rs['title']);?>">
                            <?php echo $rs['title'];?>
                        </a>
                    </h2>
                    <font class="date"><?php echo date('d/m/Y',strtotime($rs['create_date']));?></font>
                    <p>
                        <?php
                        if(strlen($rs['short_description'])>200){
                            echo cutString($rs['short_description'],200).'...';
                        }else{
                            echo $rs['short_description'];
                        }?>
                    </p>
                </li>

                <?php  $lastTagDate = $rs['create_date']; } ?>
                
            </ul>
             <div class="panaging">
                 <ul class="panation">
                      <?php
                        $totalRows =  $articles['totalRows'];
                        $totalPages = ceil($totalRows/$config ['total_article_on_category']);
                        echo paging($config ['page'],$totalPages,$config['link']);
                      ?>
                 </ul>
             </div>
            <?php
                 $ortherArticle = $tag->getOrtherOlderArticleByTag($lastTagDate,10);
                 if($db->num_rows($ortherArticle)>0){
            ?>
            <div class="bg-tab-3 margin2">
            	<ul class="tab-1">
                    <li class="current"><a href="#nogo"><b style="font-size:12px; font-weight:bold;">Các tin khác</b></a></li>
                </ul>
            </div>
            <ul class="othernews">
                <?php
                    while($rs=$db->fetch_array($ortherArticle)) {
                        ?>
            	<li>
                	<span class="left"><?php echo date('d/m/Y',strtotime($rs['create_date']));?></span>
                    <span class="right">
                        <a href="/<?php echo $rs['link'];?>.html" title="<?php echo viewTitleLink($rs['title']);?>">
                            <?php 
                            if(strlen($rs['title'])>70){
                                echo cutString($rs['title'],70).'...';
                            }else{
                                echo $rs['title'];
                            }?>
                        </a>
                    </span>
                </li>
                <?php } ?>
            </ul>
          <?php } ?>
        </div>

      

 <?php  include_once $config ['client_modules_path'].'/cate_right.php'; ?>
    </div>
<?php include_once $config ['client_theme_path'].$config ['client_theme'].'/footer.php'; ?>
